import requestProxy from '@/utils/request';

const { request } = requestProxy;

// 飞来通告tab列表
export function tabList(params) {
  return request({
    url: '/admin/queryOrder/tab',
    method: 'get',
    params
  });
}
// 飞来通告列表
export function queryOrderList(params, cancelToken) {
  return request({
    url: '/admin/queryOrder/list',
    method: 'get',
    params,
    cancelToken
  });
}
export function getOrderDashboard(params, cancelToken) {
  return request({
    url: '/admin/queryOrder/dashboard',
    method: 'get',
    params,
    cancelToken
  });
}
// 飞来通告详情通知tab列表
export function adviseabList(params) {
  return request({
    url: '/admin/queryOrder/advise/tab',
    method: 'get',
    params
  });
}
// 飞来通告详情通知列表
export function adviseList(params, cancelToken) {
  return request({
    url: '/admin/queryOrder/advise/list',
    method: 'get',
    params,
    cancelToken
  });
}
// 飞来通告详情通知列表-统计数据
export function getAdviseDashboard(params) {
  return request({
    url: '/admin/queryOrder/advise/dashboard',
    method: 'get',
    params
  });
}
// 新建飞来通告
export function queryOrderCreate(data) {
  return request({
    url: '/admin/queryOrder/create',
    method: 'post',
    data
  });
}
// 新建飞来通告
export function queryOrderEdit(id, data) {
  return request({
    url: `/admin/queryOrder/edit/${id}`,
    method: 'put',
    data
  });
}
// 删除飞来通告列表元素
export function deleteQueryOrder(id) {
  return request({
    url: `/admin/queryOrder/delete/${id}`,
    method: 'delete'
  });
}
// 获取飞来通告详情信息
export function queryOrderInfo(id, params) {
  return request({
    url: `admin/queryOrder/detail/${id}`,
    method: 'get',
    params
  });
}
// 完成或者撤回询单
export function editOrderStatus(data) {
  return request({
    url: 'admin/queryOrder/editStatus',
    method: 'post',
    data
  });
}
// 追加询单说明
export function additional(data) {
  return request({
    url: 'admin/queryOrder/additional',
    method: 'post',
    data
  });
}
// 追加账号人员
export function additionalUser(data) {
  return request({
    url: 'admin/queryOrder/additionalUser',
    method: 'post',
    data
  });
}
// 操作日志
export function logList(params) {
  return request({
    url: 'admin/queryOrder/logs',
    method: 'get',
    params
  });
}

// 操作日志备注修改
export function logRemarkEdit(data) {
  return request({
    url: 'admin/queryOrder/log/remarks',
    method: 'put',
    data
  });
}
// 筛选询单通知人员列表
export function validAdviseList(params, cancelToken) {
  return request({
    url: '/admin/queryOrder/validAdvise',
    method: 'get',
    params,
    cancelToken
  });
}
// 账号催办
export function flyUserPress(data) {
  return request({
    url: 'admin/queryOrder/press',
    method: 'post',
    data
  });
}

// 模糊搜索询单题库历史
export function queryQuestionHistory(params) {
  return request({
    url: 'admin/question/search',
    method: 'get',
    params
  });
}

// 获取问题的反馈记录
export function getQuestionReply(params) {
  return request({
    url: 'admin/question/replay',
    method: 'get',
    params
  });
}
